/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Thread;

import Packets.pkValue;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author ThuyHuynh
 */
public class SendComputerName {
    
   public static String SendName(ObjectInputStream inp,ObjectOutputStream outp)
   {String name="";
        try {
            pkValue vl = new pkValue(2, 1, "tenmay");
            outp.writeObject(vl);
            outp.flush();
            pkValue str=(pkValue) inp.readObject();
      //      inp.close();
            name = str.getObj().toString();
            System.out.println(name);
        //    outp.close();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(SendComputerName.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(SendComputerName.class.getName()).log(Level.SEVERE, null, ex);
        }
          return name;  
    }
}
